<taglib name="sohtml" />
<div class="panel crm exfieldset" style="height:330px; width:700px;">
    <form action="{:U('Customer/appointment_edit_save')}" method="post">
        <table class="table-form">
            <tr><th>客户：</th><td>
                {$data.personalName} ({$data.serialNo})
            </td></tr>
            <tr><th>预约时间：</th><td>
                <input type="text" name="time" placeholder="预约时间" value="{$data.time}" class="datetimepicker" />
            </td></tr>
            <tr><th>预约备注：</th><td>
                <input type="text" name="remark" value="{$data.remark}" size="32" placeholder="预约备注" />
            </td></tr>
        </table>
        <if condition="$data['id'] neq ''">
            <table class="table-form">
                <tr><th>回访状态：</th><td>
                    <sohtml:radio name="state" items="0=未回访;1=回访成功;2=回访失败;4=放弃回访" value="{$data.state}" />
                </td></tr>
                <tr><th>回访时间：</th><td>
                    <input type="text" name="updatedTime" placeholder="回访时间" value="{$data.updatedTime}" class="datetimepicker" />
                </td></tr>
                <tr><th>回访结果：</th><td>
                    <input type="text" name="result" value="{$data.result}" size="32" placeholder="回访结果" />
                </td></tr>
            </table>
        </if>
        <br />
                <if condition="$upr['预约客户']">
        <button type="submit">保存</button>
        <input type="reset" value="重置"/>
        </if>
        <input type='hidden' name='id' value='{$data.id}'/>
        <input type='hidden' name='customerID' value='{$data.customerID}'/>
        <input type='hidden' name='siteID' value='{$data.siteID}'/>
    </form>
    <fieldset>
        <legend>预约记录</legend>
        <div style="max-height:240px; overflow-y: auto">            
            <table class="table-grid">
                <tr><th>预约时间</th><th>预约备注</th><th>回访时间</th><th>回访结果</th><th>来源</th><th>状态</th><th>操作</th></td></tr>
                <foreach name="list" item="vo">
                    <tr><td>{$vo.time}</td><td><div class="notbreakline-ellipsis" style="width:120px;">{$vo.remark}</div></td><td>{$vo.updatedTime}</td><td><div class="notbreakline-ellipsis" style="width:120px;">{$vo.result}</div></td><td>{$vo.source|sofn_get_state_text='customer-appointment-source',###}</td><td>{$vo.state|sofn_get_state_text='customer-appointment-state',###}</td><td><a href="{:U('Customer/appointment_edit','id='.$vo['id'].'&customerID='.$vo['customerID'])}" class="btn-edit">编辑</a></td></td></tr>
                </foreach>
            </table>
        </div>
    </fieldset>
</div>
<script type="text/javascript">
    resize_dialog(730);
    $('.notbreakline-ellipsis').hover(function () {
        $(this).attr('title', $(this).text());
    })
</script>